import request from '@/utils/request'
import { effectScope } from 'vue'

// 下单请求
export const submitOrders =(orderData) => {
 return request({
   url: '/shop/ticket/buyTicket',
   method: 'post',
   data: orderData
 })}

// 获取订单列表
export const fetchOrderLists = () => {
 return request({
   url: '/shop/ticket/getOrderList',
   method: 'get'
 })}
// 支付订单
export const payOrders = (orderId) => {
 return request({
   url: '/shop/ticket/pay',
   method: 'get',
   params: { orderId }
 })}

// 取消订单
export const cancelOrder = (orderId) => {
  return request({
    url: '/shop/ticket/cancel',
    method: 'get',
    params: { orderId }
  })
}
//根据订单id获取订单
export const getTicketById = (orderId) => {
    return request({
      url: '/shop/ticket/getOrderById',
      method: 'get',
      params: { orderId }
    })
  }